<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style type="text/css">
    .active1 {
      background-color: #abc123;
    }
  </style>
</head>
</head>
<body>
<div id="app">
  <span :class="{active1:IsActive}">测试1</span>
  <span :class="{active1:IsActive}">测试2</span>
  <p>
    <button @click="IsActive=!IsActive">切换</button>
  </p>
</div>
<!-- 1:引包 -->
<script type="text/javascript" src="../../node_modules/vue/dist/vue.js"></script>
<script type="text/javascript">
  new Vue({
    el: "#app",
    data: function () {
      return {
        'IsActive': true
      }
    }
  })
</script>
</body>
</html>
